package com.spi.service;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author lyj
 * @Title: SpiTest
 * @ProjectName spi-demo
 * @Description: TODO
 * @date 2021/1/17 19:44
 */

public class SpiTest {
    public static void main(String[] args) {
        ServiceLoader<SpiService> load = ServiceLoader.load(SpiService.class);
        Iterator<SpiService> iterator = load.iterator();
        while(iterator.hasNext()){
            SpiService ser = iterator.next();
            ser.execute();
        }

    }
}
